﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public static class NumericExtension
    {
        public static bool IsEmpty(this int value)
        {
            return value == 0;
        }
        public static bool IsEmpty(this int? value)
        {
            if (value != null)
                return ((int)value).IsEmpty();

            return false;
        }

        public static bool IsInvalidKey(this int value)
        {
            return value <= 0;
        }

        //big int 

        public static bool IsEmpty(this Int64 value)
        {
            return value == 0;
        }

        public static bool IsEmpty(this Int64? value)
        {
            if (value != null)
                return ((Int64)value).IsEmpty();

            return false;
        }

        public static bool IsInvalidKey(this Int64 value)
        {
            return value <= 0;
        }

        //float 

        public static bool IsEmpty(this float value)
        {
            return value == 0;
        }

        public static bool IsEmpty(this float? value)
        {
            if (value != null)
                return ((float)value).IsEmpty();

            return false;
        }

        //double 

        public static bool IsEmpty(this double value)
        {
            return value == 0;
        }

        public static bool IsEmpty(this double? value)
        {
            if (value != null)
                return ((double)value).IsEmpty();

            return false;
        } 
    }
}
